package generic2;

/**
 * @Auther: 杨通通
 * @Date: 2024/11/22 22:45
 * @Description:
 */
public class extend1 {


    public static void main(String[] args) {
        Animal<String> a1 = new Animal<>();
        a1.updateName("hello");
        Dog<String> d1 = new Dog<>();
        d1.updateName("hello");
    }
}

class Animal<T>{
    private T name;

    void updateName(T name){
        System.out.println(name.getClass().getSimpleName());
        this.name = name;
    }
    T getName(){
        return name;
    }
}

class Dog<E> extends Animal{

}